com.cete.dynamicpdf
Class HeaderFooterTemplate
Example : This example shows how to create a header footer template and add it to the document.
import com.cete.dynamicpdf.*;
import com.cete.dynamicpdf.pageelements.*;
public class MyClass {
public static void main(String args[]) {
// Create a PDF Document
Document document = new Document();
// Add 5 blank pages to the document
document.getPages().add( new Page( PageSize.LETTER ) );
document.getPages().add( new Page( PageSize.LETTER ) );
document.getPages().add( new Page( PageSize.LETTER ) );
document.getPages().add( new Page( PageSize.LETTER ) );
document.getPages().add( new Page( PageSize.LETTER ) );
// Create a header footer template
HeaderFooterTemplate template = new HeaderFooterTemplate("HeaderText", "FooterText");
// Add the template to the document
document.setTemplate( template );
// Save the PDF document
document.draw( "[physicalpath]/MyDocument.pdf" );
}
}